<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;

abstract class BaseModel extends Model
{

    const CREATED_AT = 'createTime';
    const UPDATED_AT = 'updateTime';

    protected function serializeDate(DateTimeInterface $date): string
    {
        /** @var \Carbon\Carbon $date */
        return $date->timezone('Asia/Shanghai')->format('Y-m-d H:i:s');
    }

    protected $hidden = [
        'createTime',
        'updateTime'
    ];
}
